import ViewRouteDto from '@/ui/antd/service/router/types/model/dto/ViewRouteDto'
import UpmsMenuAndAuthorityTree from '@/core/upms/types/model/dto/UpmsMenuAndAuthorityTree'
import UpmsMenuShowStatusEnum from '@/core/upms/enums/UpmsMenuShowStatusEnum'
import UpmsMenuResponse from '@/core/upms/types/model/response/UpmsMenuResponse'
import UpmsAuthorityResponse from '@/core/upms/types/model/response/UpmsAuthorityResponse'

class MenuMockUtils {
	toMenu = (viewRouteDto: ViewRouteDto): UpmsMenuAndAuthorityTree => {
		return {
			menu: {
				title: viewRouteDto.title,
				icon: viewRouteDto.icon,
				sort: 0,
				showStatus: UpmsMenuShowStatusEnum.DISPLAY.getCode(),
				uri: viewRouteDto.path,
			} as Partial<UpmsMenuResponse>,
			authority: {} as UpmsAuthorityResponse,
			children: [],
		} as UpmsMenuAndAuthorityTree
	}
}

export default new MenuMockUtils()
